//package controllers.jobs;
//
//import enums.TrialStatus;
//import order.OrderItem;
//import play.Logger;
//import play.jobs.Job;
//import play.jobs.On;
//import utils.DateUtil;
//
//import java.util.Date;
//import java.util.List;
//import java.util.Map;
//
///**
// * Created by Administrator on 2018/4/21.
// */
//@On("00 00 01 * * ?")
////@Every("2mn")
//public class OrderTrialStatusOverJob extends Job {
//    public void doJob() {
//        Logger.info("TrialStatusOverJob------------ : %s","结束投诉订单定时任务");
//        orderTrialStatusOverDay();
//
//    }
//
//    public synchronized void orderTrialStatusOverDay(){
//        Date nowDat = new Date();
//        Date beforeDay = DateUtil.getBeforeDate(nowDat,10);
//        Logger.info("orderTrialStatusOverDay：------------ : %s",beforeDay);
//        Date beginDay = DateUtil.getBeginOfDay(beforeDay);
//        Date endDay = DateUtil.getEndOfDay(beforeDay);
//        List<Map<String ,Object >> orders = OrderItem.trialStatusOverListr( DateUtil.dateToString(beginDay,"yyyy-MM-dd HH:mm:ss"), DateUtil.dateToString(endDay,"yyyy-MM-dd HH:mm:ss"));
//        for(Map<String , Object> orderMap : orders){
//            String  oiId = orderMap.get("id").toString();
//            OrderItem orderItem = OrderItem.findByIdDel(Long.parseLong(oiId));
//            orderItem.trialStatus = TrialStatus.UN_TRIAL;
//            orderItem.save();
//        }
//
//    }
//}
